#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int judge(int x)
{
	for(int i = 2;i*i<=x;i++)
	{
		if(x%i==0) return 1;
	}
	return 0;
}
int main()
{
	//init();
	int n;
	//printf("****\n");
	while(scanf("%d",&n)!=EOF)
	{
		int flag = 0;
		int a,b;
		for(int i = 4;i<=n/2;i++)
		{
			if(judge(i)&&judge(n-i))
			{
				cout<<i<<" "<<n-i<<endl;
				break;
			}
		}
	}
	
} 
